<?php
include 'mySQLConnect.php';
?>
    <div class="sidebar">
        <div class="first">
            <h2><a>Danh mục</a></h2>
            <ul>
                <?php
                $sql3 = "SELECT * FROM category";

                $result3 = mysql_query($sql3);
                while ($row3 = mysql_fetch_array($result3)) {
                    ?>
                    <li>
                        <a href="searchProduct.php?type=cate&cat_id=<?php echo $row3['id'] ?>"><?php echo urldecode($row3['cat_name']) ?></a>
                    </li>
                <?php } ?>
            </ul>
        </div>
        <div>
            <h2><a>Tìm Kiếm</a></h2>

            <form action="searchProduct.php" method="get">
                <input type="hidden" name="type" value="price">
                <table>
                    <tr>
                        <td><label for="pStart">Từ giá: </label></td>
                    </tr>
                    <tr>
                        <td><input type="text" name="pStart" placeholder="Từ giá"
                                   value="<?php echo(empty($_GET['pStart']) ? "" : $_GET['pStart']) ?>">
                        </td>
                    </tr>
                    <tr>
                        <td><label for="pEnd">Tới giá: </label></td>
                    </tr>
                    <tr>
                        <td><input type="text" name="pEnd" placeholder="Tới giá"
                                   value="<?php echo(empty($_GET['pEnd']) ? "" : $_GET['pEnd']) ?>">
                        </td>
                    </tr>
                    <tr>
                        <td><input type="submit" value="Tìm sản phẩm"></td>
                    </tr>
                </table>
            </form>
        </div>
        <div>
            <h2><a href="#">Quảng cáo</a></h2>
            <ul>
                <li><img src="images/quancao.jpg"></li>
            </ul>
        </div>
    </div>

<?php
include 'mySQLClose.php';
?>